Java API
To use the Java API for TPT, include in your Java project <TPT installation path>\public\tptapi.jar
.
The example file <TPT installation folder>\examples\TPT-API\api-example.zip
contains a Java Eclipse project. You can import it directly into Eclipse.
The examples illustrate how to model a test case (ExampleTestModeling.java
) and how to execute test sets (ExampleTestExecution.java
) when using the Java TPT API. Read Readme.txt
to get more information.
To open the Java TPT API documentation:
- select
<TPT_INSTALL_DIR>/manuals/TPT API-html
, or - select Views|Show view|Help and click TPT API, see (1) in Figure " Click 'TPT API' to open the Java TPT API documentation"
To learn how the Java TPT API documentation is organized, click Help, see (2) in Figure " Click 'TPT API' to open the Java TPT API documentation".
Using the TPT API from within MATLAB
It is possible to use TPT API function calls from within MATLAB. To do so, add at least the following lines to the m-script:
if(~exist('com.piketec.tpt.api.TptApi', 'class'))
javaaddpath([tptInstallPath, '\public\tptapi.jar'])
end
TPTAPI = com.piketec.tpt.api.TptApiUtils.connect('TptApi', 1099);
You can omit the first three lines if you have installed the TPT Toolbox in MATLAB, see also MATLAB/Simulink platform - TPT Toolbox.